﻿var cs_cbgc = "#efefef", lanXmlDoc, thefunName, setImged, posted = false;
var promodel = new Array();
promodel[0] = 1;
promodel[1] = 2;
promodel[2] = 3;
var w3c = (document.getElementById) ? true : false;
var agt = navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
function ieBody() { return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body; }
//var lan;if(location.href.indexOf("/htmlen/")>0){lan=0;}else{lan=1;}
var dtd;
if (document.compatMode == "BackCompat") { dtd = false; } else { dtd = true; }

function clientWidth() { return ieBody().clientWidth; }
function clientHeight() { return ieBody().clientHeight; }
function scrollWidth() { return ieBody().scrollWidth; }
function scrollHeight() { return ieBody().scrollHeight; }
function scrollLeft() { return ie ? ieBody().scrollLeft : window.pageXOffset; }
function scrollTop() { return ie ? ieBody().scrollTop : window.pageYOffset; }
function getId(id) { return document.getElementById(id); }
function getName(str) { return document.getElementsByName(str); }
function getTag(str) { return document.getElementsByTagName(str); }
function getFid(id) { return parent.document.getElementById(id); }
function getFCK(id) { try { return FCKeditorAPI.GetInstance(id).GetXHTML(true); } catch (e) { return ""; } }

website_io();

function setMenuOn(objid) {
    var obj = getId(objid);
    if (obj) {
        objs = obj.getElementsByTagName("a");
        for (var i = 0; i < objs.length; i++) {
            var href = objs[i].href;
            if (location.href.indexOf(href) >= 0) objs[i].className += " on";
        }
    }
}

function menuco(thisobj, id) {
    var obj = getId(id);
    if (obj) {
        obj.style.display = "";
        thisobj.onmouseout = function () { obj.style.display = "none"; };
    }
}

function setbanner(id) {
    var src;
    var obj = getId("banner");
    if (id == "index") { src = webpath + "images/bannerindex.gif"; }
    else if (id == "job") { src = webpath + "images/bannerjob.gif"; }
    else {
        var sec = ajax(webpath + "fun/getValue.asp?sql=select banner from alz_class where classid=" + id);
        if (sec != "") { src = webpath + "images/banner/" + sec; }
        else { src = webpath + "images/banner1.gif"; }
    }
    obj.style.background = "url('" + src + "') center";
}

function setheadpic(obj) {
    var v = obj.value;
    var img = getId("headpic");
    img.src = webpath + "images/head/" + v + ".gif";
}

function getRadio(name) {
    var obj = getName(name);
    var re = "";
    if (obj) { for (i = 0; i < obj.length; i++) { if (obj[i].checked) re = obj[i].value; } }
    return re;
}

function getCheckbox(thename) {
    var checkboxArr = getTag("input");
    var funstr = "", funstr2 = "";
    for (i = 0; i < checkboxArr.length; i++) {
        if (checkboxArr[i].type == "checkbox") {
            if (checkboxArr[i].name == thename) {
                if (funstr != "") funstr2 = ","
                if (checkboxArr[i].checked) { funstr += funstr2 + checkboxArr[i].value };
            }
        }
    }
    return funstr;
}

function sucmsg(mes, url) {
    if (mes != "") { alert(mes); }
    if (url != "") { location.href = url; }
}

function sucgoto(mes, url, s) {
    pageloaded();
    s = formatnum(s, 1);
    var sucgotoObj = getId("sucgoto"), loop, times = 1;
    if (!sucgotoObj) { alert("ERROR-ALZ-JS-SUCGOTO"); } else { sucgotoObj.style.display = ""; }
    if (mes != "") {
        sucgotoObj.innerHTML = "<table><tr><td class='sucgoto_l'></td><td class='sucgoto_c'>" + mes + "</td><td class='sucgoto_r'></td></tr></table>";
        var pW = clientWidth();
        var pH = clientHeight();
        var pTop = scrollTop();
        setCookie("pageScollTop", pTop);
        var tW = sucgotoObj.clientWidth;
        var tH = sucgotoObj.clientHeight;
        sucgotoObj.style.top = (pH - tH) / 2 + pTop + "px";
        sucgotoObj.style.left = (pW - tW) / 2 + "px";
    }
    function DelayS() {
        if ((url != "" || url == "0") && times >= s) {
            goto(url);
            clearInterval(loop);
            return;
        } else if (times >= s) {
            if (sucgotoObj) { if (sucgotoObj) sucgotoObj.style.display = "none"; }
            unlock_button();
            clearInterval(loop);
            return;
        }
        times++;
    }
    if (s == 1) { DelayS(); } else { loop = setInterval(DelayS, 1000); }
    sucgotoObj.onclick = function () { clearInterval(loop); goto(url); if (sucgotoObj) { sucgotoObj.style.display = "none"; }; unlock_button(); return; }
    document.onkeydown = function (e) { e = window.event || e; if (e.keyCode == 116) return; clearInterval(loop); goto(url); if (sucgotoObj) { sucgotoObj.style.display = "none"; }; unlock_button(); return; }
}

function goto(url) {
    switch (url) {
        case "": break;
        case null: break;
        case "self": location.href = location.href.split("?")[0]; break;
        case 0: location.href = location.href.split("#")[0]; break;
        case "0": location.href = location.href.split("#")[0]; break;
        case 1: history.go(-1); break;
        case "1": history.go(-1); break;
        case 2: history.go(-2); break;
        case "2": history.go(-2); break;
        default: location.href = url;
    }
}

function pageScollTop() {
    var sH = scrollHeight();
    var pageScollTop = formatnum(getCookie("pageScollTop"), 0);
    if (pageScollTop != 0) {
        try { ieBody().scrollTop = pageScollTop; } catch (e) { window.pageYOffset = pageScollTop; };
        setCookie("pageScollTop", 0);
    }
}

function bgcc(e, tags, color, className) {
    if (Null(color)) color = cs_cbgc;
    if (Null(className)) className = "";
    if (!e.target) e.target = e.srcElement;
    var el = e.target;
    if (el.nodeName != tags) {
        while (el.parentNode && el.parentNode.tagName != tags) el = el.parentNode;
        el = el.parentNode;
    }
    if (el && (el.parentNode.parentNode.className == className || className == "")) {
        el.style.backgroundColor = color;
        el.onmouseout = function () { el.style.backgroundColor = ""; };
    }
}

function inputc(e, color) {
    if (!e.target) e.target = e.srcElement;
    var el = e.target;
    if (el.nodeName == "INPUT" && (el.type == "text" || el.type == "password") || el.nodeName == "TEXTAREA") {
        var theclear = false;
        if (el.className.indexOf("alz") >= 0) theclear = true;
        var inputdefvalue = el.value;
        el.onfocus = function () {
            if (theclear) el.value = "";
            el.style.backgroundColor = color;
        }
        el.onblur = function () {
            if (theclear && el.value == "") el.value = inputdefvalue;
            el.style.backgroundColor = "";
        }
    }
}

function loadImg(srcstr) {
    var imgArr = srcstr.split(",");
    for (i = 0; i < imgArr.length; i++) { eval("var imgs" + i + "=new Image();imgs" + i + ".src=imgArr[" + i + "];"); }
}

function target(id, cases) {
    var obj = getId(id);
    if (obj) {
        var objs = obj.getElementsByTagName("a");
        if (objs) { for (i = 0; i < objs.length; i++) { objs[i].target = cases; } }
    }
}

function noright() { noright2(window.document); }
function noright2(obj) {
    if (obj) {
        obj.oncontextmenu = function () { return false; }
        obj.ondragstart = function () { return false; }
        obj.onselectstart = function () { return false; }
        obj.onselect = function () { obj.selection.empty(); }
        obj.oncopy = function () { obj.selection.empty(); }
        obj.onbeforecopy = function () { return false; }
    }
}

function haveright() { haveright2(window.document); }
function haveright2(obj) {
    obj.oncontextmenu = function () { return true; }
    obj.ondragstart = function () { return true; }
    obj.onselectstart = function () { return true; }
    obj.onbeforecopy = function () { return true; }
}

function lang(lanstr) {
    if (lanstr.indexOf("?") > 0)
        return eval(lanstr.split("?")[0]);
    else
        return eval(lanstr);
}

function Null(str) {
    if (typeof (str) == "undefined" || str == "")
        return true;
    else
        return false;
}

function formatnum(nums, err) {
    if (typeof (nums) == "undefined" || nums == "" || isNaN(nums))
        return parseInt(err);
    else
        return parseInt(nums);
}

function ajaX(url, secid, str) {
    var xmlhttp = ajax_driv(), obj;
    if (url.indexOf("?") >= 0) { url += "&t_t=" + Math.random(); } else { url += "?t_t=" + Math.random(); }
    xmlhttp.open("get", url, true);
    if (typeof (secid) == "object") { obj = secid; } else { obj = getId(secid); }
    if (Null(str)) str = "<img src='" + webpath + "images/loading3.gif' />";
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState < 4 && obj) { obj.innerHTML = str; }
        if (xmlhttp.readyState == 4) {
            var response = xmlhttp.responseText;
            if (obj) obj.innerHTML = response;
        }
    };
    xmlhttp.send(null);
}

function ajax_post(url, urlcs) {
    var xmlhttp = ajax_driv();
    xmlhttp.open("post", url, true);
    xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState < 4) { try { ajax_post1(); } catch (e) { lock_button(); } }
        if (xmlhttp.readyState == 4) {
            var response = xmlhttp.responseText;
            try { ajax_post2(response); } catch (e) { sucgoto(response, 0, 3); }
        }
    }
    if (urlcs.substring(urlcs.length - 1, urlcs.length) == "&") urlcs += "_i=" + Math.random();
    xmlhttp.send(urlcs);
}

function getFormValue(form, postName) {
    if (Null(postName)) postName = "post_";
    var funstr = "";
    var tags = form.elements;
    for (i = 0; i < tags.length; i++) {
        var obj = tags[i];
        var theclassName = obj.className;
        if (theclassName.indexOf(postName) >= 0) {
            var ckstr = theclassName.split(postName)[1];
            if (ckstr != "" && obj.value == "") {
                alert(ckstr);
                obj.focus();
                return "{false}";
            } else {
                switch (obj.type) {
                    case "checkbox":
                        if (obj.checked) { funstr += obj.name + "=" + escape(obj.value) + "&"; };
                        break;
                    case "radio":
                        if (obj.checked) { funstr += obj.name + "=" + escape(obj.value) + "&"; };
                        break;
                    default:
                        funstr += obj.name + "=" + escape(obj.value) + "&";
                }
            }
        }
        if (theclassName.indexOf("fckEdit_") >= 0) {
            var fckValue = getFCK(obj.id);
            if (fckValue == "null" || fckValue == "false")
                funstr += obj.name + "=&";
            else
                funstr += obj.name + "=" + escape(fckValue) + "&";
        }
    }
    return funstr;
}

function ajax_driv() {
    var xmlhttp;
    if (window.ActiveXObject) {/*@cc_on @*/
        /*@if (@_jscript_version>=5)try{xmlhttp = new ActiveXObject("Msxml2.xmlhttp");}catch(e){try{
        xmlhttp = new ActiveXObject("Microsoft.xmlhttp");}catch(e){xmlhttp = false;}}
        @end @*/} else { xmlhttp = new XMLHttpRequest(); }
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); }
    return xmlhttp;
}

function ajax(url, secid) {
    if (url.indexOf("?") >= 0) { url = url + "&t=" + Math.random(); } else { url = url + "?t=" + Math.random(); }
    var responseStr = G.ajax({ url: url, async: false }).responseText;
    if (getId(secid)) { getId(secid).innerHTML = responseStr; }
    return responseStr;
}

function ajax2(url, urlcs) {
    if (Null(urlcs)) { urlcs = "alz=1" }
    var img = new Image();
    img.src = url + "?" + urlcs + "&t=" + Math.random();
}

function pageloading() {
    var objload = getId("pageloading");
    var pagewidth = clientWidth();
    var pageheight = clientHeight();
    var pagescrollTop = scrollTop();
    if (objload) {
        objload.style.top = (pageheight - objload.clientHeight + pagescrollTop) / 2 - 30;
        objload.style.left = (pagewidth - objload.clientWidth) / 2;
    }
}

function pageloaded() {
    var obj = G("#pageloading")[0];
    if (obj) { obj.style.display = "none"; }
}

function minheight(id, h) {
    var obj = getId(id);
    if (obj) {
        var h2 = obj.offsetHeight;
        if (h2 > h) { obj.style.height = "auto"; } else { obj.style.height = h + "px"; }
    }
}

//得到URL参数值
function getPra(paramName) {
    var oRegex = new RegExp("[\?&]" + paramName + "=([^&]+)", "i");
    var oMatch = oRegex.exec(location.search);
    if (oMatch && oMatch.length > 0)
        return unescape(oMatch[1]);
    else
        return "";
}

function wndClose() { try { parent.DvWnd.close(); } catch (e) { try { DvWnd.close(); } catch (e) { window.close(); } } }

function switchdiv(namestr, n, a, b) {
    for (var i = a; i <= b; i++) { getId(namestr + i).style.display = "none"; }
    getId(namestr + n).style.display = "block";
}

function T(id, n) { getId(id).style.fontSize = n + "px"; }

//数字格式控制
function onlynum(obj) { obj.value = obj.value.replace(/\D/g, '') }

//搜索
function Search_check(str1, str2) {
    if (getId("keyword").value == "" || getId("keyword").value == str1) {
        alert(str2);
        getId("keyword").focus();
        return false;
    }
}

function buttonbgcc(obj) {
    obj.className = "mybuttonOn";
    obj.onmouseout = function () { obj.className = "mybutton"; }
}

//关键字写入录入框
function ctag(obj, str, types) {
    if (getId(str).value == "") {
        getId(str).value = obj.title;
    } else {
        getId(str).value = getId(str).value + "," + obj.title
        if (types == 1 || obj.title == "") { getId(str).value = obj.title; }
    }
}

function lock_button(str) {
    if (typeof (lan_savemes) == "undefined") lan_savemes = "";
    if (Null(str)) str = "<img src='" + webpath + "images/loading1.gif' align='absmiddle' /> " + lan_savemes;
    var obj1 = getId("submit1");
    var obj2 = getId("submit2");
    var obj3 = getId("submiting");
    if (obj1) { obj1.style.display = "none"; }
    if (obj2) { obj2.style.display = "none"; }
    if (obj3) { obj3.innerHTML = str; }
}

function unlock_button() {
    var obj1 = getId("submit1");
    var obj2 = getId("submit2");
    var obj3 = getId("submiting");
    if (obj1) { obj1.style.display = ""; }
    if (obj2) { obj2.style.display = ""; }
    if (obj3) { obj3.innerHTML = ""; }
}

function switchTab(n, a, b, str) {
    for (var i = a; i <= b; i++) {
        if (i != n) {
            getId("ContentBody" + n).style.display = "block";
            getId("ContentBody" + i).style.display = "none";
            getId("ListTitle" + i).className = str + "off";
            getId("ListTitle" + n).className = str + "on";
        }
    }
    if (getId("ShowAll")) { getId("ShowAll").className = str + "off"; }
}

//选择操作（typeid: 1全选 2反选 3取消）
function sel(name, typeid) {
    var obj = getName(name)
    if (typeid == 1) {
        for (i = 0; i < obj.length; i++) { obj[i].checked = true; }
        if (getId("ids")) getId("ids").checked = true;
    } else if (typeid == 3) {
        for (i = 0; i < obj.length; i++) { obj[i].checked = false; }
        if (getId("ids")) getId("ids").checked = false;
    } else {
        for (i = 0; i < obj.length; i++) { if (obj[i].checked) { obj[i].checked = false; } else { obj[i].checked = true; } }
    }
}

//层显示与关闭
function showmenu(menuid) {
    var obj = getId("menuid" + menuid);
    var olddisplay = "";
    if (obj) { olddisplay = obj.style.display; }
    var obj2 = G(".smallclass");
    for (var i = 0; i < obj2.length; i++) { obj2[i].style.display = "none"; }
    if (olddisplay == "none") { obj.style.display = ""; }
    else { obj.style.display = "none"; }
}

//翻页跳转
function topage(obj) {
    var jmpurl = obj.value;
    if (jmpurl != '') { location.href = jmpurl; } else { this.selectedindex = 0; }
}

//操作判断
function confirm_do() { return confirm(lan_suredo); }

function autoIframe(obj, cases) {
    obj.style.display = "";
    function autoIframeLoop() {
        try {
            var bHeight = obj.contentWindow.document.body.scrollHeight;
            var dHeight = obj.contentWindow.document.documentElement.scrollHeight;
            var height = Math.max(bHeight, dHeight);
            obj.height = height;
        } catch (e) { }
    }
    if (!!cases) { setInterval(autoIframeLoop, 200); } else { autoIframeLoop(); }
    var obj2 = getId("Iframeload");
    if (obj2) { obj2.style.display = "none"; }
}

//拖动对象
var move_obj = { o: null, z: 0, x: 0, y: 0 }
function move_(e) {
    e = window.event || e;
    var oDragHandle = e.target || event.srcElement;
    var topElement = "HTML";
    while (oDragHandle.tagName != topElement && oDragHandle.className != "alt_") {
        oDragHandle = oDragHandle.parentNode || oDragHandle.parentElement;
    }
    if (oDragHandle.className == "alt_") {
        isdrag = true;
        move_obj.o = oDragHandle;
        move_obj.z = move_obj.o.style.zIndex;
        move_obj.o.style.zIndex = 999;
        y = e.clientY - parseInt(move_obj.o.style.top + 0);
        x = e.clientX - parseInt(move_obj.o.style.left + 0);
        document.onmousemove = function moveMouse(e) {
            e = window.event || e;
            if (move_obj.o) with (move_obj.o.style) {
                var yy = e.clientY - y; if (yy < 0) yy = 0; else if (yy + move_obj.o.offsetHeight > document.body.clientHeight) yy = document.body.clientHeight - move_obj.o.offsetHeight;
                var xx = e.clientX - x; if (xx < 0) xx = 0; else if (xx + move_obj.o.offsetWidth >= document.body.clientWidth) xx = document.body.clientWidth - move_obj.o.offsetWidth;
                top = yy + "px"; left = xx + "px"; return false;
            }
        }
        move_obj.o.onmouseup = function () { if (move_obj.o) { document.onmousemove = null; move_obj.o.style.zIndex = move_obj.z; } move_obj.o = null; }
        return false;
    }
}

function showtime() {
    if (lan == "1") {
        t_1 = "星期一";
        t_2 = "星期二";
        t_3 = "星期三";
        t_4 = "星期四";
        t_5 = "星期五";
        t_6 = "星期六";
        t_7 = "星期日";
        t_8 = "年";
        t_9 = "月";
        t_10 = "日";
    } else {
        t_1 = "monday";
        t_2 = "tuesday";
        t_3 = "wednesday";
        t_4 = "thursday";
        t_5 = "friday";
        t_6 = "saturday";
        t_7 = "sunday";
        t_8 = "-";
        t_9 = "-";
        t_10 = "";
    }
    var d = new Date();
    var iYear = d.getFullYear();
    var iMonth = d.getMonth();
    var iDay = d.getDate();
    var sWeek = d.getDay();
    var sHour = d.getHours();
    var sMinute = d.getMinutes();
    var sSecond = d.getSeconds();
    if (sWeek == 0) sWeek = "<font color='#ff0000'>" + t_7 + "</font>";
    if (sWeek == 1) sWeek = t_1;
    if (sWeek == 2) sWeek = t_2;
    if (sWeek == 3) sWeek = t_3;
    if (sWeek == 4) sWeek = t_4;
    if (sWeek == 5) sWeek = t_5;
    if (sWeek == 6) sWeek = "<font color='#ff0000'>" + t_6 + "</font>";
    if (sHour <= 9) sHour = "0" + sHour;
    if (sMinute <= 9) sMinute = "0" + sMinute;
    if (sSecond <= 9) sSecond = "0" + sSecond;
    sClock = iYear + t_8 + (iMonth + 1) + t_9 + iDay + t_10 + " " + sHour + ":" + sMinute + ":" + sSecond + "　" + sWeek;
    getId("clock").innerHTML = sClock;
    setTimeout("showtime()", 1000);
}

function rollleft(speed, idname) {
    var demo = getId(idname);
    var demo1 = getId(idname + "1");
    var demo2 = getId(idname + "2");
    demo2.innerHTML = demo1.innerHTML;
    function Marquee() { if (demo2.offsetWidth - demo.scrollLeft <= 0) { demo.scrollLeft -= demo1.offsetWidth; } else { demo.scrollLeft++; } }
    var MyMar = setInterval(Marquee, speed);
    demo.onmouseover = function () { clearInterval(MyMar); }
    demo.onmouseout = function () { MyMar = setInterval(Marquee, speed); }
}

function rollright(speed, idname) {
    var demo = getId(idname);
    var demo1 = getId(idname + "1");
    var demo2 = getId(idname + "2");
    demo2.innerHTML = demo1.innerHTML;
    function Marquee() { if (demo.scrollLeft <= 0) { demo.scrollLeft += demo1.offsetWidth; } else { demo.scrollLeft--; } }
    var MyMar = setInterval(Marquee, speed);
    demo.onmouseover = function () { clearInterval(MyMar); }
    demo.onmouseout = function () { MyMar = setInterval(Marquee, speed); }
}

function rollup(speed, idname) {
    var demo = getId(idname);
    var demo1 = getId(idname + "1");
    var demo2 = getId(idname + "2");
    demo2.innerHTML = demo1.innerHTML;
    function Marquee() { if (demo2.offsetTop - demo.scrollTop <= 0) { demo.scrollTop -= demo1.offsetHeight; } else { demo.scrollTop++; } }
    var MyMar = setInterval(Marquee, speed)
    demo.onmouseover = function () { clearInterval(MyMar); }
    demo.onmouseout = function () { MyMar = setInterval(Marquee, speed); }
}

function left_right(obj, speed, idname, l_r) {
    var demo = getId(idname);
    var demo1 = getId(idname + "1");
    var demo2 = getId(idname + "2");
    demo2.innerHTML = demo1.innerHTML;
    function Marquee() {
        if (l_r == 0) { if (demo2.offsetWidth - demo.scrollLeft <= 0) { demo.scrollLeft -= demo1.offsetWidth; } else { demo.scrollLeft++; demo.scrollLeft++; } } else { if (demo.scrollLeft <= 0) { demo.scrollLeft += demo1.offsetWidth; } else { demo.scrollLeft--; demo.scrollLeft--; } }
    }
    var MyMar = setInterval(Marquee, speed);
    obj.onmouseup = function () { clearInterval(MyMar); }
}

function picView(This, url, e, w, h) {
    if (getId("picViewObj")) document.body.removeChild(getId("picViewObj"));
    w = formatnum(w, 300);
    h = formatnum(h, 300);
    if (Null(url)) url = This.src;
    var pW = clientWidth();
    var pH = clientHeight();
    var sTop = scrollTop();
    var obj = document.createElement("img");
    document.body.appendChild(obj);
    obj.id = "picViewObj";
    obj.style.display = "none";
    obj.style.position = "absolute";
    obj.style.border = "1px solid #ccc";
    setImged = false;
    if (dtd) { try { imgPlay(obj, 5); } catch (e) { } }
    This.onmousemove = function (e) {
        obj.style.display = "";
        e = window.event || e;
        var x = e.clientX, y = e.clientY, theTop = parseInt(y + sTop);
        setImg(obj, w, h, url);
        if (!setImged) {
            obj.src = webpath + "images/loading.gif";
            obj.width = 32;
            obj.height = 32;
            obj.style.left = x + 20 + "px";
            obj.style.top = theTop + 20 + "px";
        } else {
            var theW = obj.width, theH = obj.height;
            if (theW + x > pW - 50) { obj.style.left = x - theW - 20 + "px"; } else { obj.style.left = x + 20 + "px"; }
            if (theH + y > pH - 20) { obj.style.top = sTop + pH - theH + "px"; } else { obj.style.top = theTop + 20 + "px"; }
        }
    }
    This.onmouseout = function () { document.body.removeChild(obj); setImged = false; }
}

//图片按比例缩放
function setImg(obj, w, h, url) {
    w = formatnum(w, 300), h = formatnum(h, 300);
    if (Null(url)) url = obj.src;
    var image = new Image(), ww, hh;
    image.onload = function () {
        setImged = true, obj.onload = null, obj.src = url;
        var wBh = image.width / image.height;
        if (wBh >= w / h) { ww = image.width >= w ? w : image.width; hh = ww / wBh; } else { hh = image.height >= h ? h : image.height; ww = hh * wBh; }
        obj.width = ww, obj.height = hh;
    }
    image.src = url;
}

//倒序页面分页函数 新闻产品采用
function pagelist(pagenums, lan, urlstr) {
    if (pagenums > 0) {
        var group_pernum = 10;	 //每组显示多少页
        var text1, text2, text3, text4, text5, text6, text7, text8, text9, text10, url;
        if (lan) { cmslanPath = "zh_cn"; } else { cmslanPath = "en"; }
        thefunName = "page2_";
        loadxml("lanXml/page2/en.xml");
        var theurl = location.href;
        if (theurl.indexOf("/") > 0 && theurl.indexOf(".html") > 0) {
            var arr = theurl.split("/");
            filename = arr[arr.length - 1];
            pageon = filename.split(".html")[0];
            if (pageon.indexOf("_") > 0) { pageon = pageon.split("_")[1]; } else { pageon = pagenums; }
        } else {
            pageon = pagenums;
        }
        if (typeof pageon == "undefined") pageon = 1;
        pageon = parseInt(pageon);
        pageon = (pagenums - pageon + 1);
        if (typeof urlstr == "undefined") {
            if (theurl.indexOf("/") > 0) {
                var arr = theurl.split("/");
                filename = arr[arr.length - 1];
                filename = filename.replace("_" + pageon, "");
                urlstr = filename.split(".html")[0];
            }
        }
        var gounps = Math.ceil(pagenums / group_pernum) //一共分多少组
        var gounpon = Math.ceil(pageon / group_pernum) //当前页码位于多少组	
        prepage = pageon - 1;
        nextpage = pageon + 1;
        pregroup = pageon - group_pernum;
        nextgroup = pageon + group_pernum;
        if (prepage < 1) { prepage = 1; }
        if (nextpage > pagenums) { nextpage = pagenums; }
        if (pregroup < 1) { pregroup = 1; }
        if (nextgroup > pagenums) { nextgroup = pagenums; }
        document.write("<div class='mypage'>");
        document.write("<a class='page_no'>" + t(8) + " " + pagenums + " " + t(11) + " / " + t(5) + " " + pageon + " " + t(6) + "</a>");
        if (pageon == 1) {
            document.write("<a class='page_no'>" + t(1) + "</a>");
        } else {
            url = urlstr + "_" + (pagenums - prepage + 1) + ".html";
            url = url.replace("_" + pagenums + ".html", ".html");
            document.write("<a href='" + url + "'>" + t(1) + "</a>");//上一页
        }
        //当前组大于一时，显示上一组
        if (gounpon > 1) {
            pregroup = pagenums - pregroup + 1;
            url = urlstr + "_" + pregroup + ".html";
            url = url.replace("_" + pagenums + ".html", ".html");
            document.write("<a href='" + url + "' title='" + t(3) + "'>&lt;&lt;</a>");
        }
        //显示位于当前组的页码
        for (var i = (gounpon - 1) * group_pernum + 1; i <= gounpon * group_pernum; i++) {
            url = urlstr + "_" + (pagenums - i + 1) + ".html";
            url = url.replace("_" + pagenums + ".html", ".html");
            if (i > pagenums) { break; }
            document.write("<a href='" + url + "'");
            if (pageon == i) { document.write(" class='page_on'"); }
            document.write(" title='" + t(5) + i + t(6) + "'>" + i + "</a>");
        }
        //当前组小于总组数时，显示下一组
        if (gounpon < gounps) {
            nextgroup = pagenums - nextgroup + 1;
            document.write("<a href='" + urlstr + "_" + nextgroup + ".html' title='" + t(4) + "'>&gt;&gt;</a>");
        }
        if (pageon == pagenums) {
            document.write("<a class='page_no'>" + t(2) + "</a>");
        } else {
            url = urlstr + "_" + (pagenums - nextpage + 1) + ".html"; //下一页
            document.write("<a href='" + url + "'>" + t(2) + "</a>");
        }
        document.write("</div>");
    }
}

function inpagelist(pages, lan) {
    if (lan) { cmslanPath = "zh_cn"; } else { cmslanPath = "en"; }
    thefunName = "page2_";
    loadxml("lanXml/page2/" + cmslanPath + ".xml");
    var pageon = getPra("page");
    var pagecell;
    pageon = formatnum(pageon, 1);
    if (pageon < 1) pageon = 1;
    if (pageon > pages) pageon = pages;
    prepage = pageon - 1;
    nextpage = pageon + 1;
    document.write("<div class='mypage'>");
    if (pageon == 1) { document.write("<a class='page_no'>" + t(1) + "</a>"); } else { document.write("<a href='?page=" + prepage + "'>" + t(1) + "</a>"); }

    for (var i = 1; i <= pages; i++) {
        document.write("<a href='?page=" + i + "'");
        if (pageon == i) { document.write(" class='page_on'"); }
        document.write(" title='" + t(5) + i + t(6) + "'>" + i + "</a>");
        pagecell = getId("mypagecell" + i);
        if (pagecell) pagecell.style.display = "none";
    }
    if (pageon == pages) { document.write("<a class='page_no'>" + t(2) + "</a>"); } else { document.write("<a href='?page=" + nextpage + "'>" + t(2) + "</a>"); }

    document.write("</div>");
    pagecell = getId("mypagecell" + pageon);
    if (pagecell) pagecell.style.display = "";
}

function pagelist2(pagenums, lan, urlstr) {
    if (urlstr == "" || urlstr == null) urlstr = "index";
    var obj = getId("newslist");
    if (getCookie('newsmodel') == "2" && obj) { obj.className = "newslist2"; }
    if (pagenums > 0) {
        var group_pernum = 10;	 //每组显示多少页
        var text1, text2, text3, text4, text5, text6, text7, text8, text9, text10, url;
        if (lan) { cmslanPath = "zh_cn"; } else { cmslanPath = "en"; }
        thefunName = "page2_";
        loadxml("lanXml/page2/" + cmslanPath + ".xml");
        var theurl = location.href;
        if (theurl.indexOf("/") > 0 && theurl.indexOf(".html") > 0) {
            var arr = theurl.split("/");
            filename = arr[arr.length - 1];
            pageon = filename.split(".html")[0];
            if (pageon.indexOf("_") > 0) { pageon = pageon.split("_")[1]; } else { pageon = 1; }
        }
        if (typeof pageon == "undefined") pageon = 1;
        pageon = parseInt(pageon);
        if (typeof urlstr == "undefined") {
            if (theurl.indexOf("/") > 0) {
                var arr = theurl.split("/");
                filename = arr[arr.length - 1];
                filename = filename.replace("_" + pageon, "")
                urlstr = filename.split(".html")[0];
            }
        }
        var gounps = Math.ceil(pagenums / group_pernum) //一共分多少组
        var gounpon = Math.ceil(pageon / group_pernum) //当前页码位于多少组	
        prepage = pageon - 1;
        nextpage = pageon + 1;
        pregroup = pageon - group_pernum;
        nextgroup = pageon + group_pernum;
        if (prepage < 1) { prepage = 1; }
        if (nextpage > pagenums) { nextpage = pagenums; }
        if (pregroup < 1) { pregroup = 1; }
        if (nextgroup > pagenums) { nextgroup = pagenums; }
        document.write("<div class='mypage'>")
        document.write("<a class='page_no'>" + t(8) + " " + pagenums + " " + t(11) + " / " + t(5) + " " + pageon + " " + t(6) + "</a>");
        if (pageon == 1) {
            document.write("<a class='page_no'>" + t(1) + "</a>");
        } else {
            url = urlstr + "_" + prepage + ".html";
            url = url.replace("_1.html", ".html");
            document.write("<a href='" + url + "'>" + t(1) + "</a>");
        }
        if (gounpon > 1) {
            url = urlstr + "_" + pregroup + ".html"
            url = url.replace("_1.html", ".html");
            document.write("<a href='+url+' title='" + t(3) + "'>&lt;&lt;</a>");
        } //当前组大于一时，显示上一组		
        //显示位于当前组的页码
        for (var i = (gounpon - 1) * group_pernum + 1; i <= gounpon * group_pernum; i++) {
            url = urlstr + "_" + i + ".html";
            url = url.replace("_1.html", ".html");
            if (i > pagenums) { break; }
            document.write("<a href='" + url + "'");
            if (pageon == i) { document.write(" class='page_on'"); }
            document.write(" title='" + t(5) + i + t(6) + "'>" + i + "</a>");
        }
        if (gounpon < gounps) { document.write("<a href='" + urlstr + "_" + nextgroup + ".html' title='" + t(4) + "'>&gt;&gt;</a>"); } //当前组小于总组数时，显示下一组		
        if (pageon == pagenums) {
            document.write("<a class='page_no'>" + t(2) + "</a>");
        } else {
            url = urlstr + "_" + nextpage + ".html";
            url = url.replace(urlstr + "_1.html", urlstr + ".html");
            document.write("<a href='" + url + "'>" + t(2) + "</a>");
        }
        document.write("</div>");
    }
}
//图片——链接类型 1为无 2为大图片 3为自定义
function linktypes(typeid) { if (typeid == "3") { getId("link").style.display = ""; } else { getId("link").style.display = "none"; } }

function setCookie(name, value) {
    var Days = 30;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
    document.cookie = co_ + name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
}

function getCookie(name) {
    var arr, reg = new RegExp("(^| )" + co_ + name + "=([^;]*)(;|$)");
    if (arr = document.cookie.match(reg)) return unescape(arr[2]);
    else return '';
}

function changemodel(types) {
    if (types == "news") {
        var obj = getId("newslist");
        if (obj) { if (obj.className == "newslist") { obj.className = "newslist2"; setCookie("newsmodel", "2"); } else { obj.className = "newslist"; setCookie("newsmodel", "1"); } }
    } else {
        var obj2 = getId("pro_list");
        if (types == "pro1") { if (obj2) { obj2.className = "pro_list1"; setCookie("pro_model", "pro_list1"); changemodel2(1); } }
        if (types == "pro2") { if (obj2) { obj2.className = "pro_list2"; setCookie("pro_model", "pro_list2"); changemodel2(2); } }
        if (types == "pro3") { if (obj2) { obj2.className = "pro_list3"; setCookie("pro_model", "pro_list3"); changemodel2(3); } }
    }
}

function changemodel2(id) {
    for (i = 1; i <= 3; i++) { getId("promodel_" + i).src = getId("promodel_" + i).src.replace("on.gif", ".gif"); }
    getId("promodel_" + id).src = getId("promodel_" + id).src.replace(".gif", "on.gif");
}

function setProModel() {
    var proClassName = getCookie("pro_model");
    if (proClassName)
        getId("pro_list").className = proClassName;
    else
        getId("pro_list").className = "pro_list" + promodel[0];
    if (proClassName == "pro_list" + promodel[2]) {
        getId("promodel_" + promodel[0]).src = webpath + "images/view_mode_a.gif";
        getId("promodel_" + promodel[1]).src = webpath + "images/view_mode_b.gif";
        getId("promodel_" + promodel[2]).src = webpath + "images/view_mode_con.gif";
    }
    else if (proClassName == "pro_list" + promodel[1]) {
        getId("promodel_" + promodel[0]).src = webpath + "images/view_mode_a.gif";
        getId("promodel_" + promodel[1]).src = webpath + "images/view_mode_bon.gif";
        getId("promodel_" + promodel[2]).src = webpath + "images/view_mode_c.gif";
    }
    else {
        getId("promodel_" + promodel[0]).src = webpath + "images/view_mode_aon.gif";
        getId("promodel_" + promodel[1]).src = webpath + "images/view_mode_b.gif";
        getId("promodel_" + promodel[2]).src = webpath + "images/view_mode_c.gif";
    }
}

function changeorder(types) {
    var orders = getCookie(types + "_order_type");
    if (orders == "1") {
        setCookie(types + "_order_type", 2);
        history.go(0);
    } else {
        setCookie(types + "_order_type", 1);
        history.go(0);
    }
}

function setProOrder() {
    var orders = getCookie("pro_order_type");
    var pro_order = getId("pro_order");
    if (orders == 1) { pro_order.src = "images/view_mode_d.gif"; } else { pro_order.src = "images/view_mode_don.gif"; }
}

function comefrom(typeid) { if (typeid && typeid == 1) { setCookie("pro_list_url", location.href); } else { setCookie("new_list_url", location.href); } }

function backtolist(typeid) {
    var url1 = getCookie("pro_list_url");
    var url2 = getCookie("new_list_url");
    if (typeid && typeid == 1 && url1 != "") { location.href = url1; } else if (typeid && typeid == 2 && url2 != "") { location.href = url2; } else { location.href = "../../"; }
}

//进度条函数，结合sub loadingbar使用
function loadingbar(id, numson, numsall, w) {
    var barwidth = numson / numsall * w;
    var percenter = parseInt(numson / numsall * 100) + "%";
    getId("loadingbar" + id).style.width = barwidth;
    getId("loadnum" + id).innerHTML = percenter;
}

function picclick(id, path) { ajax2(path + "picclick.asp", "id=" + id + "&add=1"); }

function randomChar(m, types) {
    var tmp = "";
    var str = "0123456789poiuytrewqasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM";
    var str1 = "0123456789poiuytrewqasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM";
    if (types == "num") { str = "0123456789"; str1 = "0123456789"; }
    if (types == "Num") { str = "0123456789"; str1 = "123456789"; }
    if (types == "videobg") { str = "0123456789"; str1 = "12345"; }
    for (var i = 0; i < m; i++) {
        if (i == 0) { tmp += str1.charAt(Math.ceil(Math.random() * 100000000) % str1.length); } else { tmp += str.charAt(Math.ceil(Math.random() * 100000000) % str.length); }
    }
    return tmp;
}

function get_Code(path) {
    var Dv_CodeFile = path + "alz_admin/alz_GetCode.asp?t=" + Math.random();
    var codeimg = getId("codeimg");
    if (codeimg) codeimg.src = Dv_CodeFile;
}

function submitForm(formID) {
    if (window.event.ctrlKey && window.event.keyCode == 13) { document.getElementById(formID).submit(); }
}

function copy(obj) {
    obj.select();
    js = obj.createTextRange();
    js.execCommand("Copy");
}

function setFile(title, path, secid, other) {
    DvWnd.open("文件管理", 'alz_admin/file/index.asp?path=' + path + '&secid=' + secid + '&other=' + other + '&_i=' + Math.random());
}

function ding(typeid, id) {
    ajaX(webpath + "fun/comment/ding.asp?typeid=" + typeid + "&id=" + id + "&add=1", "dingnum", "<img src='" + webpath + "images/loading3.gif' />");
    var dingA = G("#ding a")[0];
    if (dingA) { dingA.innerHTML = "谢谢参与"; }
}

function ping(typeid, id, clicked) {
    if (!!clicked) {
        DvWnd.open("发表评论", webpath + "fun/comment/index.asp?add=1&typeid=" + typeid + "&id=" + id + "&lan=" + cmslan, 550, 280);
    } else {
        ajaX(webpath + "fun/comment/ping.asp?typeid=" + typeid + "&id=" + id, "pingnum", "<img src='" + webpath + "images/loading3.gif' />");
        var pingA = G("#ping a")[0];
        if (pingA) { pingA.innerHTML = "谢谢参与"; }
    }
}

function seachtype(typeid) {
    var obj = getId("keyword");
    var objform = getId("searchform");
    if (typeid == 2) {
        if (objform) { objform.action = "http://www.google.cn/custom"; objform.target = "_blank"; }
        if (obj) obj.name = "q";
    } else if (typeid == 3) {
        if (objform) { objform.action = "http://www.baidu.com/baidu"; objform.target = "_blank"; }
        if (obj) obj.name = "word";
    } else {
        if (objform) { objform.action = "search.asp"; objform.target = ""; }
        if (obj) obj.name = "keyword";
    }
}

function vPic(id) {
    var obj = getId(id), altStr;
    if (lan) { altStr = "Click to big" } else { altStr = "Click to enlarge" }
    if (obj) {
        obj.onmouseover = function () {
            var objImg = obj.getElementsByTagName("img"), srcStr = "";
            for (var i = 0; i < objImg.length; i++) {
                if (objImg[i].src.indexOf("loading") < 1) {
                    srcStr += decodeURI(objImg[i].src) + ",";
                    objImg[i].className += " zoomIn";
                    objImg[i].alt = altStr;
                    eval("var obj" + i + "=objImg[" + i + "]");
                    eval("obj" + i + ".onclick=function(){toBig(obj" + i + ",srcStr," + i + ");}");
                }
            }
        }
    }
}
function toBig(obj, srcStr, nowI, addUrl) {
    var nowSrc = obj.src;
    if (Null(srcStr)) srcStr = nowSrc;
    if (typeof (nowI) == "undefined") {
        if (srcStr.indexOf(",") > 0) {
            var picArr = srcStr.split(",");
            for (var i = 0; i < picArr.length; i++) { if (nowSrc.indexOf(picArr[i]) >= 0) nowI = i; }
        } else nowI = 0;
    }
    if (Null(addUrl)) addUrl = "";
    setCookie("viewPicCs", lan + "{$}" + addUrl + "{$}" + nowI + "{$}" + nowSrc + "{$}" + srcStr);
    window.open(webpath + "zoom/", "_blank", "fullscreen=yes");
}

function returnimgcode(theimg) {
    var imghtml = "";
    if (theimg[1] != "") imghtml = '<a href="' + theimg[1] + '" target="_blank">';
    imghtml += '<img src="' + theimg[0] + '" />';
    if (theimg[1] != "") imghtml += '</a>';
    return imghtml;
}

function modifyimage(loadarea, imgindex) {
    var filterstring = "progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 duration=0.7)";
    var imgobj = getId(loadarea);
    if (imgobj.filters && window.createPopup) {
        imgobj.style.filter = filterstring;
        imgobj.filters[0].Apply();
    }
    imgobj.innerHTML = returnimgcode(proimgs[imgindex]);
    if (imgobj.filters && window.createPopup) imgobj.filters[0].Play();
    return false;
}

function website_io() {
    //if (!page_on("alz_admin")) {
    //    if (!!!web_io) {
    //        setCookie("error", "web_io");
    //        location.href = webpath + "fun/error.asp";
    //    }
    //    var xmlhttp = ajax_driv();
    //    xmlhttp.open("get", webpath + "fun/alz_ipCheck.asp", true);
    //    xmlhttp.onreadystatechange = function () {
    //        if (xmlhttp.readyState == 4) {
    //            var response = xmlhttp.responseText;
    //            if (response.indexOf("{LOCK}") >= 0) {
    //                setCookie("error", "ipCheck");
    //                location.href = webpath + "fun/error.asp";
    //            }
    //        }
    //    };
    //    xmlhttp.send(null);
    //}
}

function page_on(url) {
    if (location.href.indexOf(url) >= 0)
        return true;
    else
        return false;
}

function loadxml(lanXmlPath) {
    lanXmlDoc = newXmlObj();
    lanXmlDoc.load(webpath + lanXmlPath);
    return lanXmlDoc;
}

function newXmlObj() {
    var dom;
    if (ie) { dom = new ActiveXObject("MSXML2.DOMDocument"); } else { dom = document.implementation.createDocument("", "", null); }
    if (dom) { dom.async = false; return dom; } else { return false; }
}

function t(lanstr) {
    if (typeof (thefunName) != "undefined" && thefunName != "") lanstr = thefunName + lanstr;
    if (typeof (lanXmlDoc) != "object") { return "[NO:" + lanstr + "/]"; }
    try {
        if (lanstr.indexOf("/") >= 0) {
            var lanstrArr, uboundArr, funstr = lanXmlDoc;
            lanstrArr = lanstr.split("/");
            uboundArr = lanstrArr.length - 1;
            for (var i = 0; i <= uboundArr; i++) {
                if (uboundArr != i) { funstr = funstr.getElementsByTagName(lanstrArr[i]).item(0); }
                else {
                    if (ie) { funstr = funstr.getElementsByTagName(lanstrArr[uboundArr]).item(0).text; }
                    else { funstr = funstr.getElementsByTagName(lanstrArr[uboundArr]).item(0).textContent; }
                }
            }
        }
        else {
            if (ie) { funstr = lanXmlDoc.getElementsByTagName(lanstr).item(0).text; }
            else { funstr = lanXmlDoc.getElementsByTagName(lanstr).item(0).textContent; }
        }
        return funstr;
    }
    catch (e) { return "[" + lanstr + "]"; }
}

function chang_img(url) {
    var obj = getId("big_img");
    imgPlay(obj, 5);
    setImg(obj, 500, 500, "images/propic/" + url);
}

function imgPlay(obj, cases) {
    var transitions = new Array;
    transitions[0] = "progid:DXImageTransform.Microsoft.Fade(duration=1)";
    transitions[1] = "progid:DXImageTransform.Microsoft.Blinds(duration=1,bands=20)";
    transitions[2] = "progid:DXImageTransform.Microsoft.Checkerboard(duration=1,squaresX=20,squaresY=20)";
    transitions[3] = "progid:DXImageTransform.Microsoft.Strips(duration=1,motion=rightdown)";
    transitions[4] = "progid:DXImageTransform.Microsoft.Barn(duration=1,orientation=vertical)";
    transitions[5] = "progid:DXImageTransform.Microsoft.GradientWipe(duration=0.5,GradientSize=1.0)";
    transitions[6] = "progid:DXImageTransform.Microsoft.Iris(duration=1,motion=out)";
    transitions[7] = "progid:DXImageTransform.Microsoft.Wheel(duration=1,spokes=12)";
    transitions[8] = "progid:DXImageTransform.Microsoft.Pixelate(maxSquare=10,duration=1)";
    transitions[9] = "progid:DXImageTransform.Microsoft.RadialWipe(duration=1,wipeStyle=clock)";
    transitions[10] = "progid:DXImageTransform.Microsoft.RandomBars(duration=1,orientation=vertical)";
    transitions[11] = "progid:DXImageTransform.Microsoft.Slide(duration=1,slideStyle=push)";
    transitions[12] = "progid:DXImageTransform.Microsoft.RandomDissolve(duration=1,orientation=vertical)";
    transitions[13] = "progid:DXImageTransform.Microsoft.Spiral(duration=1,gridSizeX=40,gridSizeY=40)";
    transitions[14] = "progid:DXImageTransform.Microsoft.Stretch(duration=1,stretchStyle=push)";
    var i = formatnum(cases, -1);
    if (i < 0) { i = sjs(transitions.length - 1); } else { i = cases; }
    obj.style.filter = transitions[i]; obj.filters[0].Apply(); obj.filters[0].Play();
}

function isEmail(email) {
    var patrn = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    if (!patrn.exec(email)) return false;
    return true;
}

function isUserName(str) {
    var patrn = /^[a-zA-Z0-9_-]{2,}$/;
    if (!patrn.exec(str)) return false
    return true
}

function setHome(obj) { obj.style.behavior = "url(#default#homepage)"; obj.setHomePage("" + weburl + ""); return false; }
function setSc() { window.external.addFavorite('' + weburl + '', '' + company + ''); }
function rePlace(str, str1, str2) { while (str.indexOf(str1) >= 0) { str = str.replace(str1, str2); }; return str; }
function sjs(i) { return Math.floor(Math.random() * (i + 1)); }
Number.prototype.toFixed = function (d) {
    var s = this + ""; if (!d) d = 0;
    if (s.indexOf(".") == -1) s += "."; s += new Array(d + 1).join("0");
    if (new RegExp("^(-|\\+)?(\\d+(\\.\\d{0," + (d + 1) + "})?)\\d*$").test(s)) {
        var s = "0" + RegExp.$2, pm = RegExp.$1, a = RegExp.$3.length, b = true;
        if (a == d + 2) {
            a = s.match(/\d/g); if (parseInt(a[a.length - 1]) > 4) {
                for (var i = a.length - 2; i >= 0; i--) {
                    a[i] = parseInt(a[i]) + 1;
                    if (a[i] == 10) { a[i] = 0; b = i != 1; } else break;
                }
            }
            s = a.join("").replace(new RegExp("(\\d+)(\\d{" + d + "})\\d$"), "$1.$2");
        }
        if (b) s = s.substr(1); return (pm + s).replace(/\.$/, "");
    } return this + "";
}
function showObj(obj, ww, hh) {
    ww = formatnum(ww, 0), hh = formatnum(hh, 0);
    var w = parseInt(obj.style.width);
    var h = parseInt(obj.style.height);
    var speed, temp, add;
    if (ww > w && hh > h) { speed = 5; temp = 0; add = true } else { speed = -5; temp = 100; add = false; }
    function loops() {
        temp += speed;
        if (add) { speed++; temp = temp > 100 ? 100 : temp; } else { speed--; temp = temp < 1 ? 0 : temp; }
        w = ww * temp / 100;
        h = hh * temp / 100;
        obj.style.width = w + "px";
        obj.style.height = h + "px";
        if (temp == 100 || temp == 0) { clearInterval(loop); return; }
    }
    var loop = setInterval(loops, 10);
}

function changeDiv(n) {
    var objArr = G(".changeDiv");
    var objArrs = G(".changeDivs");
    if (Null(n) && n != 0) {
        //var nowN=formatnum(getCookie("changeDivId"),0);
        //for(i=0;i<objArr.length;i++){objArr[i].className=objArr[i].className.replace(" on","");}
        //objArr[nowN].className+=" on";	
        for (i = 0; i < objArrs.length; i++) { objArrs[i].style.display = "none"; }
        //objArrs[nowN].style.display="";	
    } else {
        for (i = 0; i < objArr.length; i++) { objArr[i].className = objArr[i].className.replace(" on", ""); }
        objArr[n].className += " on";
        for (i = 0; i < objArrs.length; i++) { objArrs[i].style.display = "none"; }
        objArrs[n].style.display = "";
        setCookie("changeDivId", n);
    }
}